#ifndef _drawthread_h_included_
#define _drawthread_h_included_
#include "CThread.h"
#include "Game.h"
#include "Profiler.h"

class DrawThread : public CThread
{
	Game* mGame;
	CProfiler* profiler;

  virtual DWORD Run( LPVOID arg )
  {
	 profiler = CProfiler::GetInstance();
	 profiler->Initialize("DrawThread",LOGALL);	
    while(1)
    {
		profiler->ProfileStart("Update","DrawThread","",false,1);
		mGame->Update(41);
		profiler->ProfileEnd("Update","DrawThread");

		profiler->ProfileStart("Draw","DrawThread","",false,1);
        mGame->Draw();
		profiler->ProfileEnd("Draw","DrawThread");
		
		profiler->ProfileStart("Present","DrawThread","",false,1);
		mGame->Present();
		profiler->ProfileEnd("Present","DrawThread");

		profiler->ProfileStart("ScreenShot","DrawThread","",false,1);
		mGame->ScreenShot();
		profiler->ProfileEnd("ScreenShot","DrawThread");

    }
	profiler->Shutdown();

  }

  public:
  DrawThread(Game* pGame){mGame = pGame; 
  }
};

#endif
